﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KC.Presentation.ModuTweet
{
	public partial class DebugConsole : Form
	{
		public DebugConsole()
		{
			InitializeComponent();
		}

		private void btnClose_Click(object sender, EventArgs e)
		{
			Close();
		}

		public void debug(string msg)
		{
			txtDebug.Text += DateTime.Now.ToString("HH:mm:ss") + msg.Trim() + "\r\n";
			if (txtDebug.Text.Length > 1000000) txtDebug.Text = txtDebug.Text.Substring(900000).Trim() + "\r\nDebug log full; reverse truncated.\r\n";
			if (cbLive.Checked) {
				txtDebug.SelectionStart = txtDebug.Text.Length - 1;
				txtDebug.ScrollToCaret(); }
		}
	}
}
